<!--
 * @Date: 2019-12-23 11:21:52
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2020-04-29 11:53:36
 * @describe: -写跟进-
 -->
<template>
  <div class="addFollow">
    <el-dialog title="写跟进" :visible.sync="addFollowVisible" width="30%">
      <el-form ref="form" :model="FollowForm" label-width="50px" label-position="top">
        <el-form-item label="跟进方式">
          <ren-select v-model="FollowForm.type" dict-type="followType" style="width:100%"></ren-select>
        </el-form-item>
        <el-form-item label="跟进内容">
          <el-input v-model="FollowForm.content" type="textarea" :rows="4"></el-input>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="addFollowVisible = false">取 消</el-button>
        <el-button type="primary" @click="FollowFun" :loading="BtnLoading">添加</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: "",
  data() {
    return {
      addFollowVisible: false,
      FollowForm: {
        content: "",
        type: ""
      },
      BtnLoading: false
    };
  },
  created() {},
  mounted() {},
  methods: {
    init() {
      this.addFollowVisible = true;
    },
    FollowFun() {
      this.$http
        .post("/house/houseinfo/saveFollow/", this.FollowForm)
        .then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg);
          }
          this.$message.success("添加跟进成功！");
          this.$parent.getPageFollow();
          this.addFollowVisible = false;
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "添加失败"
          });
        });
    }
  },
  activated() {}
};
</script>
<style scoped>
</style>